package com.liuweiheng.cloudproviderpayment8002.mq.receiver;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费者：直连模式
 */
@Component
@RabbitListener(queuesToDeclare = @Queue(name = "hello", durable = "true", exclusive = "false", autoDelete = "true"))
public class HelloReceiver {

    @RabbitHandler
    public void receive(String message) {
        System.out.println("Hello队列：" + message);
    }

}
